RFSD_TARGET = rfsd
RFSPASSWD_TARGET = rfspasswd

RFSD_OBJS = rfsd.o \
sendrecv.o \
signals.o \
command.o \
buffer.o \
server_handlers.o \
signals_server.o \
list.o \
exports.o \
passwd.o \
keep_alive_server.o \
crypt.o \
path.o \
read_cache.o \
id_lookup.o

RFSPASSWD_OBJS = rfspasswd.o \
buffer.o \
list.o \
passwd.o \
crypt.o \
signals.o

all: $(RFSD_OBJS) $(RFSPASSWD_OBJS) link_server link_passwd

link_server:
	$(CC) $(RFSD_OBJS) $(RFSD_LDFLAGS) -o $(RFSD_TARGET)

link_passwd:
	$(CC) $(RFSPASSWD_OBJS) $(RFSPASSWD_LDFLAGS) -o $(RFSPASSWD_TARGET)

%.o : %.c
	$(CC) -c $(CFLAGS) -Wall $< -o $@

clean:
	rm -f *.o
	rm -f $(RFSD_TARGET)
	rm -f $(RFSPASSWD_TARGET)

install:
	mkdir -p ${INSTALL_DIR}
	cp ${RFSD_TARGET} ${INSTALL_DIR}
	cp ${RFSPASSWD_TARGET} ${INSTALL_DIR}
